{
  interface BaseInfo{
    name: string;
  }

  //接口的继承
  interface BoyFriend extends BaseInfo{
    age: number;
    car ?: string;
    cook: () => void;
  }

  interface Programmer extends BaseInfo{
    program: () => void;
  }

  let boy:BoyFriend = {
    name: '李易峰',
    age: 35,
    cook: () => {
      console.log('会做蛋炒饭~~');
    }
  };

  let boy2: BoyFriend = {
    name: '王嘉尔',
    age: 29,
    car: '比亚迪',
    cook(){
      console.log('会做地三鲜~~');
    }
  }

  // implements 是 ES5 严格模式的保留字
  // implements 实现
  class Person implements BoyFriend, Programmer{
    name: string;
    age: number;
    weight: string;
    //构造器
    constructor(name: string, age: number, weight: string){
      this.name = name;
      this.age = age;
      this.weight = weight;
    }

    cook(){
      console.log('我会做饭~~');
    }

    program(){
      console.log('我可以编程哦~~');
    }
  }
  

  //实例化对象
  let ikun = new Person('坤坤', 24, '130');

  ikun.program();


  

}